package org.example.wh.cope.util;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import lombok.extern.slf4j.Slf4j;
import org.example.common.BaseWarehouseReqParam;
import org.example.wh.cope.param.CopeResParam;
import org.example.wh.cope.param.createOutbound.CopeCreateOutboundResParam;

import java.text.MessageFormat;

@Slf4j
public class CopeHttpUtil {
    
    /**
     * 创建出库单
     * @param baseWarehouseReqParam
     * @return
     */
    public static CopeResParam createOutbound(BaseWarehouseReqParam<?> baseWarehouseReqParam) {
        log.info("请求仓库参数：{}", JSON.toJSON(baseWarehouseReqParam));

        CopeCreateOutboundResParam copeCreateOutboundResParam = new CopeCreateOutboundResParam();
        copeCreateOutboundResParam.setOrderId(111);

        CopeResParam<CopeCreateOutboundResParam> copeResParam = new CopeResParam<>();
        copeResParam.setCode(200);
        copeResParam.setMessage("成功");
        copeResParam.setData(copeCreateOutboundResParam);

        log.info("仓库返回：{}", JSON.toJSON(copeResParam));
        return copeResParam;
    }

}
